package ru.aptu.gsp_banking.service_impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import ru.aptu.gsp_banking.dao.AccountDAO;
import ru.aptu.gsp_banking.domain.Account;
import ru.aptu.gsp_banking.service.AccountService;

import java.util.List;

/**
 * Created by IntelliJ IDEA.
 * User: alex
 * Date: 11/16/11
 * Time: 4:05 PM
 */

@Service
public class AccountServiceImpl implements AccountService {

    @Autowired
    private AccountDAO accountDAO;

    @Transactional
    public List<Account> listAccount(String currentUser) {
        return accountDAO.listAccount(currentUser);
    }

    @Transactional
    public boolean checkAccount(Integer accountId, String name) {
        return accountDAO.checkAccount(accountId, name);
    }

    @Transactional
    public String getAccountNumber(Integer accountId) {
        return accountDAO.getAccountNumber(accountId);
    }
}
